package com.antjupt.servlet;
/**
 * @author Wizarder
 * @create 2021-05-25 15:28
 */

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;

public class ContextServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ServletContext servletContext = getServletContext();
        String realPath = servletContext.getRealPath("/");
        System.out.println(realPath);//G:\JavaWeb\out\artifacts\06_servlet_war_exploded\
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
